/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author ronaldo
 */
import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.logging.Level;
import java.util.logging.Logger;

public class OLDCODE {
//        private void Cons() {
//        AntCons = txtInput.getText();
//        String Selected = "";
//        try {
//            //String jdbURL = "jdbc:dbf://///home/ronaldo/.wine/dosdevices/d:/documentacion en 192.168.5.24/tinoco";
//            //String jdbURL = "jdbc:dbf://///home/ronaldo/Escritorio";
//            String jdbURL = this.ur1.getText().trim() + this.ur2.getSelectedItem().toString();
//            Class.forName("com.caigen.sql.dbf.DBFDriver");
//            
//            Properties props = new Properties();
//            props.setProperty("delayedClose", "0");
//            
//            Connection conn = DriverManager.getConnection(jdbURL, props);
//            Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
//            
//            
//            
//            ResultSet rs;
////            try {
//            if (cbxCAC.isSelected()) {
//                txtOutput.setText("");
//            }
//            
//            
//            try {
//                Selected = txtInput.getSelectedText();
//                Selected.length();
//            } catch (Exception e) {
//                Selected = this.txtInput.getText();
//            }
//            
//            
//            rs = stmt.executeQuery(Selected);
//            ResultSetMetaData resultSetMetaData = rs.getMetaData();
//            
//            int nc = resultSetMetaData.getColumnCount();
//            this.txtColumns.setText("\n\n");
//            for (int i = 1; i <= nc; i++) {
//                txtColumns.append(resultSetMetaData.getColumnName(i)
//                        + "  \t" + resultSetMetaData.getColumnTypeName(i)
//                        + "  \t" + resultSetMetaData.getPrecision(i)
//                        + "  \t" + resultSetMetaData.getScale(i) + "\n");
//            }
//            
//            for (int i = 1; i <= nc; i++) {
//                txtOutput.append(resultSetMetaData.getColumnName(i) + "\t\t");
//            }
//            
//            Object colval;
//            txtOutput.append("\n---------------------------------------------------------------------------");
//            txtOutput.append("\n---------------------------------------------------------------------------\n");
//            int nreg = 0;
//            
//            while (rs.next()) {
//                for (int j = 1; j <= nc; j++) {
//                    colval = rs.getObject(j);
//                    txtOutput.append(colval + "\t\t");
//                }
//                nreg++;
//                this.lblNRegistro.setText(String.valueOf(rs.getRow()));
//                txtOutput.append("\n");
//            }
//            
//            txtOutput.append("\n---------------------------------------------------------------------------");
//            txtOutput.append("\n---------------------------------------------------------------------------\n");
//            rs.close();
////            } catch (Exception e) {
////                try {
////                    stmt.execute(this.txtInput.getText());
////                } catch (Exception eInter) {
////                    txtOutput.append("\n" + eInter.getMessage());
////                }
////            }
//
////                sql="drop table if exists testUsers;";
////                System.out.println(sql);
////                stmt.execute(sql);
//
//            
//            stmt.close();
//            conn.close();
//        } catch (SQLException sqle) {
//            String jdbURL = this.ur1.getText().trim() + this.ur2.getSelectedItem().toString();
//            try {
//                Class.forName("com.caigen.sql.dbf.DBFDriver");
//                Properties props = new Properties();
//                props.setProperty("delayedClose", "0");
//                
//                Connection conn = DriverManager.getConnection(jdbURL, props);
//                Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
//                
//                stmt.executeUpdate(Selected);
//                txtOutput.append("Consulta Update Query ---" + "\n");
//            } catch (SQLException ex) {
//                Logger.getLogger(Consoler.class.getName()).log(Level.SEVERE, null, ex);
//            } catch (ClassNotFoundException ex) {
//                Logger.getLogger(Consoler.class.getName()).log(Level.SEVERE, null, ex);
//            }
//            do {
//                txtOutput.append(sqle.getMessage() + "\n");
//                txtOutput.append("Error Code:" + sqle.getErrorCode() + "\n");
//                txtOutput.append("SQL State:" + sqle.getSQLState() + "\n");
//                sqle.printStackTrace();
//            } while ((sqle = sqle.getNextException()) != null);
//        } catch (Exception e) {
//            txtOutput.append(e.getMessage() + "\n");
//            //e.printStackTrace();
//        }
//        this.txtLog.append(Selected + "\n----------------\n");
//        txtOutput.setCaretPosition(txtOutput.getDocument().getLength());
//        //SFolder();
//        this.txtDBF.setCaretPosition(txtDBF.getDocument().getLength());
//        this.txtLog.setCaretPosition(txtLog.getDocument().getLength());
//    }

    public static void main(String a[]) {
        try {
            InetAddress address = InetAddress.getByName("192.168.5.150");

            boolean reachable = address.isReachable(10000);

            System.out.println("Es el host alcanzable? " + reachable);
        } catch (IOException ex) {
            Logger.getLogger(OLDCODE.class.getName()).log(Level.SEVERE, null, ex);
        } catch (Exception ex) {
            Logger.getLogger(OLDCODE.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
